<?php


namespace app\admin\services\wechat;


use WeChat\Contracts\BasicWeChat;

class WechatServices
{

    protected $appid ;
    protected $appsecret;
    protected $GetAccessTokenCallback;
    protected $cache_path;
    protected $wechat;
    protected $access_token;

    public function __construct()
    {
        $this->appid = config('wechat.appid');
        $this->appsecret = config('wechat.appsecret');
        $this->GetAccessTokenCallback = config('wechat.GetAccessTokenCallback');
        $this->cache_path = config('wechat.cache_path');
        $this->wechat = new BasicWeChat(config('wechat'));
        $this->access_token = $this->get_access_token();
    }

    //获取access_token
    public function get_access_token()
    {
        return $this->wechat->getAccessToken();
    }

    //

}